<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:82:"D:\wwwroot\fangcms_city_add\public/../application/mobile\view\user\login\pass.html";i:1493805827;s:80:"D:\wwwroot\fangcms_city_add\public/../application/mobile\view\public\layout.html";i:1493803137;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title><?php echo $seo['title']; ?></title>
    <meta name="Keywords" content="<?php echo $seo['keys']; ?>">
    <meta name="Description" content="<?php echo $seo['desc']; ?>">
    <link rel="stylesheet" href="__CSS__/amazeui.min.css"/>
    <link type="text/css" rel="stylesheet"  href="__CSS__/main.css"/>
    <link rel="stylesheet" href="__CSS__/mobile.css">
    <script src="__PUBLIC__/js/jquery.min.js"></script>
    <script>
        var page = 1,flag  = true,params =  {page: page};
    </script>
</head>
<body>

<header data-am-widget="header" class="am-header am-header-default">
    <div class="am-header-left am-header-nav">
        <a href="javascript:history.back();" class="">
            <i class="am-header-icon am-icon-chevron-left"></i>
        </a>
    </div>
    <h1 class="am-header-title">
        <?php if(isset($info)): ?><?php echo $info['title']; else: ?><?php echo $title; endif; ?>
    </h1>
    <div class="am-header-right am-header-nav">
        <a href="<?php echo url('Index/index'); ?>" class="">
            <i class="am-header-icon am-icon-home"></i>
        </a>
    </div>
</header>


<style>
    .main{padding:10px;background-color: #fff;}
    .am-form .am-form-group input{padding:8px 8px 8px 28px;}
</style>
<div class="main ">
    <div class="ylj-box ylj-padding-t-b ylj-margin-b">
        <form action="<?php echo url('pass'); ?>" method="post" id="myForm" data-uri="<?php echo url('ajaxCheckUser'); ?>" class="am-form ylj-padding-l-r" >
            <div class="am-form-group am-form-icon">
                <i class="am-icon-phone"></i>
                <input type="text" name="mobile" id="mobile" class="am-form-field" placeholder="注册时填写的手机号码">
            </div>
            <div class="am-form-group am-form-icon">
                <i class="am-icon-envelope"></i>
                <input type="text" name="email" id="email" class="am-form-field" placeholder="注册时填写的邮箱号码">
            </div>
            <div class="am-form-group am-form-icon">
                <i class="am-icon-image"></i>
                <input type="text" class="am-form-field" name="code" id="code" style="padding-right:140px;" placeholder="验证码">
                <button type="button" onclick="getCode();" id="smsCode" class="am-fr am-btn ylj-btn-color" style="position:absolute;top:0;right:0;">获取验证码</button>
            </div>
            <div class="am-form-group am-form-icon">
                <i class="am-icon-lock"></i>
                <input type="password" name="password" id="password" class="am-form-field" placeholder="密码">
            </div>
            <div class="am-form-group am-form-icon">
                <i class="am-icon-lock"></i>
                <input type="password" name="repassword" id="password2" class="am-form-field" placeholder="确认密码">
            </div>

            <div class="am-form-group">
                <button type="button" id="ylj-sub-btn" onclick="$('#myForm').submit();" class="am-btn ylj-btn-color am-btn-block am-round">重置密码</button>
            </div>
        </form>
    </div>

</div>
<script src="__PUBLIC__/js/plugins/layervalide.js"></script>
<script src="__PUBLIC__/js/plugins/jquery.ajax.form.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script>
    $(function(){
        $.formValidator.initConfig({formid:"myForm",autotip:true});
        $("#mobile").formValidator({onshow:'',onfocus:'请填写手机号码'}).regexValidator({regexp:"mobile",datatype:"enum",onerror:"请填写注册时的手机号码"}).ajaxValidator({
            type : "get",
            url : $('#myForm').data('uri'),
            datatype : "json",
            async:'false',
            success : function(result){
                if(result.status == 1){
                    return false;
                }else{
                    return true;
                }
            },
            onerror : '该手机号码不存在',
            onwait : '查询中,请稍候...'
        });
        $("#email").formValidator({onshow:'',onfocus:'请填写邮箱号码'}).regexValidator({regexp:"email",datatype:"enum",onerror:"请填写注册时的邮箱号码"}).ajaxValidator({
            type : "get",
            url : $('#myForm').data('uri'),
            datatype : "json",
            async:'false',
            success : function(result){
                if(result.status == 1){
                    return false;
                }else{
                    return true;
                }
            },
            onerror : '该邮箱号码不存在',
            onwait : '查询中,请稍候...'
        });
        $("#code").formValidator({onshow:'',onfocus:'请填写验证码'}).inputValidator({min:6,max:6,onerror:'验证码由6个字符组成'});
        $("#password").formValidator({onshow:'',onfocus:'请填写密码'}).inputValidator({min:6,onerror:'密码至少由6个字符组成'});
        $("#repassword").formValidator({onshow:"",onfocus:"请再次填写密码"}).compareValidator({desid:"password",operateor:"=",onerror:"输入两次密码不同。"});
        $('#myForm').ajaxForm({success:complate,dataType:'json'});
        function complate(result){
            if(result.status == 1){
                layer.msg(result.msg,{icon:1});
                setTimeout(function(){window.location.href = result.uri;},2000);
            } else {
                layer.msg(result.msg,{icon:2});
            }
        }
    });
    var time=60,times='';
    function getCode(){
        if(time<60) return false;
        var email = $("#email").val(),mobile=$("#mobile").val();
        $.post("<?php echo url('user.login/getEmailCode'); ?>",{'email':email,'mobile':mobile},function(data){
            if(data.status==1){
                time --;
                layer.msg('验证码发送成功，请注意查收',{icon:1});
                times = setInterval(timer,1000);
            }else{
                layer.msg(data.msg);
            }
        });
    }
    function timer(){
        var code = $("#smsCode");
        if(time == 0){
            time = 61;
            code.text('获取验证码');
            clearInterval(times);

        }else{
            code.text(time+'秒后重新获取');
        }
        time --;
    }
</script>

<footer data-am-widget="footer" class="am-footer am-footer-default" data-am-footer="{  }">
    <div class="am-footer-switch"><?php $n=0; if(is_array($menu) || $menu instanceof \think\Collection || $menu instanceof \think\Paginator): $i = 0; $__LIST__ = $menu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;if($vo['pos'] == 2): $n++; if(!(empty($vo['alias']) || (($vo['alias'] instanceof \think\Collection || $vo['alias'] instanceof \think\Paginator ) && $vo['alias']->isEmpty()))): $url=url($vo['model'].'/detail',['cate'=>$vo['alias']]); else: $url=url($vo['model'].'/index'); endif; if($n > 1): ?><span class="am-footer-divider"> | </span><?php endif; ?><a class="am-footer-desktop" href="<?php echo $url; ?>"><?php echo $vo['title']; ?></a>
        <?php endif; endforeach; endif; else: echo "" ;endif; ?>

    </div>
    <div class="am-footer-miscs ">

        <p>&copy;<?php echo date('Y'); ?>版权所有 <?php echo $site['title']; ?></p>
        <p>客服电话：<?php echo $site['telphone']; ?></p>
    </div>
    <div class="fang-footer-bar">
        <ul class="am-avg-sm-4">
            <li><a href="<?php echo url('Index/index'); ?>" <?php if($controller == "index"): ?>class="on"<?php endif; ?>><i class="am-icon-home am-icon-sm"></i><p>首页</p></a></li>
            <li><a href="<?php echo url('Loupan/index'); ?>" <?php if($controller == "loupan"): ?>class="on"<?php endif; ?>><i class="am-icon-building am-icon-sm"></i><p>新房</p></a></li>
            <li><a href="<?php echo url('Second/index'); ?>" <?php if($controller == "second"): ?>class="on"<?php endif; ?>><i class="am-icon-institution am-icon-sm"></i><p>二手</p></a></li>
            <li><a href="<?php echo url('user.index/index'); ?>"><i class="am-icon-user am-icon-sm"></i><p>我的</p></a></li>
        </ul>
    </div>
</footer>
<?php echo $site['mobileJs']; if(isset($ajaxdata)): ?>
<div id="loadingToast" class="am-hide">
    <div class="ylj-mask"></div>
    <div class="ylj-toast">
        <i class="ylj-loading weui-icon_toast"></i>
        <p class="ylj-toast__content">数据加载中</p>
    </div>
</div>
<script src="__PUBLIC__/js/layer/laytpl.js"></script>
<script>
    $(function(){
        $(window).scroll(function(){
            if(($(window).scrollTop() + $(window).height() > $(document).height()-10) && flag){
                var totalpage = $("#lists").data('total');
                if(totalpage > 1 && totalpage >= page){
                    $("#loadingToast").removeClass('am-hide');
                    getData();
                }else{
                    $("#loading-alt").removeClass('am-hide');
                    flag = false;
                }
            }
        });
    });
    function getData(){
        var url =  $("#lists").data('uri');
        $.get(url,params,function(data){
            $("#loadingToast").addClass('am-hide');
            if(data.status == 1){
                if(data.data){
                    var gettpl = document.getElementById('template').innerHTML;
                    laytpl(gettpl).render(data.data, function(html){
                        $('#lists').append(html);
                    });
                }else{
                    $('#lists').html('<li>暂无数据</li>');
                }

            }else{
                $("#loading-alt").removeClass('am-hide');
                flag = false;
            }
        });
        page++;
    }
</script>
<?php endif; ?>
</body>
</html>